package composite;

import java.util.Vector;

public class D implements IFace {
	
	private Vector<IFace> v = new Vector<IFace>();

	private String name;
	public D(String name) {
		this.name = name;
	}
	@Override
	public void say() {

		System.out.println(this.name);
		if(v.isEmpty()){
			
			return;
		}else {
			for(IFace i : v){
				i.say();
			}
		}
		
	}
	
	public void add(IFace i){
		this.v.add(i);
	}
	
	public void remove(IFace i){
		this.v.remove(i);
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

}
